import java.util.*;

public class MyDesk {
	
	private Map<String, ResourceType> collectors;
	private Index myIndex;
	
	
	public MyDesk() {
		collectors = new HashMap<String, ResourceType>();
		myIndex = new Index();
	}
	
	public void registerType(String extension, ResourceType type) {
		collectors.put(extension, type);
	}
	
	public ResourceType getType(String extension) {
		return (collectors.get(extension));
	}
	
	public void unregisterType(String extension) {
		collectors.remove(extension);
	}
	
	public void registerResource(Resource res) {
		myIndex.add(res);
	}
	
	public List<Resource> processRequest(String request) {
		return (myIndex.getResources(request));
	}

}
